using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace Sec_scan漏洞扫描系统
{
    public partial class Sec_Scan_HomePage : Form
    {
        public Sec_Scan_HomePage()
        {
            InitializeComponent();
        }

        private List<int> XList = new List<int>();
        private List<int> YList = new List<int>();
        private Random randoms = new Random();
        private void HomePage_Load(object sender, EventArgs e)
        {
            chart2.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.NotSet; //设置网格类型为虚线
            chart2.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash; //设置网格类型为虚线
            chart2.Series[0].IsValueShownAsLabel = true;//设置显示示数

            for (int i = 0; i < 6; i++)
            {
                XList.Add(i);
                YList.Add(randoms.Next(10, 100));
            }
            //写法同上面到 chart1.ChartAreas[0] 类似
            chart2.Series["严重漏洞"].Points.DataBindXY(XList, YList);
            chart2.Series["高危漏洞"].Points.DataBindXY(XList, YList);
            chart2.Series["中危漏洞"].Points.DataBindXY(XList, YList);
            chart2.Series["低危漏洞"].Points.DataBindXY(XList, YList);
            chart1.Series["执行频率"].Points.DataBindXY(XList, YList);
        }
    }
}
